<?php
$enclosures = get_post_meta($post->ID, 'enclosure');
if (count($enclosures)):
?>
<div class="resource enclosure">
<h4>Play Audio</h4>
<?php
$noAutoStart = true;

foreach ($enclosures as $enclosure):
$mp3 = split("\n", $enclosure);

if (!$mp3[2] || ($mp3[2] && ereg('audio',$mp3[2]))):
$flashVars = 'playerID=1'.(!$noAutoStart ? '&amp;autostart=yes' : '').'&amp;bg=0xf8f8f8&amp;leftbg=0xeeeeee&amp;lefticon=0x666666&amp;rightbg=0xcccccc&amp;rightbghover=0x999999&amp;righticon=0x666666&amp;righticonhover=0xFFFFFF&amp;text=0x666666&amp;slider=0x666666&amp;track=0xFFFFFF&amp;border=0x666666&amp;loader=0x9FFFB8&amp;soundFile=';

?>
<div class="media audio">
<object type="application/x-shockwave-flash" data="/wp-content/themes/tantan/mp3/musicplayer2.swf" width="290" height="24" id="audioplayer1"><br />
<param name="movie" value="/wp-content/themes/tantan/musicplayer2.swf" />
<param name="FlashVars" value="<?=$flashVars?><?=urlencode($mp3[0])?>" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
</object><br>
<br>

<p>
<a href="<?php echo $mp3[0]?>" class="download">Right click to download this audio file &raquo;</a>
</p>
</div>

<?php
elseif ($mp3[2] && ereg('video/quicktime',$mp3[2])):?>
<div class="media video">
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="256" width="320">
<param name="src" value="<?php echo $mp3[0];?>">
<param name="autoplay" value="<?php echo (!$noAutoStart ? 'true' : 'false')?>">
<param name="type" value="video/quicktime" height="256" width="320">
<embed src="<?php echo $mp3[0];?>" height="256" width="320" autoplay="<?php echo (!$noAutoStart ? 'true' : 'false')?>" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/">
</object>

</div>
<?php 
endif; // ereg
endforeach; // enclosures
?>
</div>
<?php
endif; // count
?>
